/**
 * 核心技术支持
 * IT渠道网 小程序商城
 * 13873174181 微信同号
 */
import {Base} from 'base.js';

class Nav extends Base {
    constructor() {
        super();
    }
    /**
     * 获得店铺精选
     */
    getStoreList(page, callback) {
        var allParams = {
            url: 'min/user/storeList?page=' + page,
            sCallback: function (data) {
               callback && callback(data)
            }
        }
        this.request(allParams);
    }

    /**
     * 签到积分记录
     */
    findSign(page, callback) {
        var allParams = {
            url: 'min/user/signList?page=' + page,
            sCallback: function (data) {
               callback && callback(data)
            }
        }
        this.request(allParams);
    }
    /**
     * 签到
     */
    signIn(callback) {
        var allParams = {
            url: 'min/user/addSign',
            sCallback: function (data) {
               callback && callback(data)
            }
        }
        this.request(allParams);
    }

    /**
     * 商城优惠券
     */
    findCoupon(param, callback) {
        var allParams = {
            url: 'min/user/findCoupon',
            type: 'post',
            data: param,
            sCallback: function (data) {
               callback && callback(data)
            }
        }
        this.request(allParams);
    }
    /**
     * 领取优惠券
     */
    getCoupon(param, callback) {
        var allParams = {
            url: 'min/user/addCoupon',
            type: 'post',
            data: param,
            sCallback: function (data) {
               callback && callback(data)
            }
        }
        this.request(allParams);
    }

    /**
     * 用户优惠券
     */
    findMyCoupon(param, callback) {
        var allParams = {
            url: 'min/user/findMyCoupon',
            type: 'post',
            data: param,
            sCallback: function (data) {
               callback && callback(data)
            }
        }
        this.request(allParams);
    }
    /**
     * 获取用户
     */
    findUser(callback) {
        var allParams = {
            url: 'min/user/getOne',
            sCallback: function (data) {
               callback && callback(data)
            }
        }
        this.request(allParams);
    }

    /**
     * 获取专题
     */
    findSpecial(sid, callback) {
        var allParams = {
            url: 'min/user/findSpecial?id=' + sid,
            sCallback: function (data) {
               callback && callback(data)
            }
        }
        this.request(allParams);
    }
}

export {Nav};